var baseUrl = 'http://www.itcbc.com:8080'
$.ajaxPrefilter(function (options) {
    options.url = baseUrl + options.url;
    if (options.url.includes('/my/')) {
        options.headers = {
                'authorization': localStorage.getItem('token')
            }
            options.complete = function (xhr) {
                console.log(xhr);
                if (xhr.responseJSON && xhr.responseJSON.status === 1 && xhr.responseJSON.message === '身份认证失败！') {
                    localStorage.removeItem('token');
                    if (location.href.includes('index.html')) {
                        location.href = './login.html'
                    } else {
                        window.parent.location.href = '../login.html'
                        
                    }
                    
                }
            }

    }


});